//144
class Solution {
    public List<Integer> preorderTraversal(TreeNode root) {

        List<Integer> list = new ArrayList<>();
        if (root == null) return list;
        list.add(root.val);
        List<Integer> leftList = preorderTraversal(root.left);
        list.addAll(leftList);
        List<Integer> rightList = preorderTraversal(root.right);
        list.addAll(rightList);
        return list;
    }
}
public class leetcode {

}
